The present invention relates to an improved method and circuit for controlling an interrupt whereby an ordinary flow of a program being executed in a processor is forcibly suspended and another more urgent and significant program is executed instead.
Below, a description will be given to a conventional method of controlling an interrupt in a processor. If an interrupt is requested during the execution of a program, the processor is brought into an interrupt state so as to suspend the process being executed in the program. Prior to the execution of another process interrupting, the processor stores the address (specifically, the value of a program counter for specifying the address of an instruction to be subsequently executed so as to control the sequential execution of instructions) of the process suspended in the above program and writes the address of the interrupt process in the above program counter. The processor then executes the interrupt process and, upon completion of the execution of the process, reads out the value stored in the above program counter, so as to return to the above suspended process and resume it.
In addition to the interrupt control method mentioned above, there is another interrupt control method whereby, if another interrupt is requested by an interrupt process that is more urgent during the execution of the above interrupt process, the operation proceeds to execute the program that is more urgent than the previous interrupt program. When the execution of the more urgent process is completed, the operation returns to the previous interrupt process and resumes it. When the execution of the previous interrupt process is completed, the operation returns to the original process and resumes it.
A conventional interrupt control circuit comprises: a stack of LIFO (last-in first-out) structure for temporarily storing data required for returning to the original process that has been suspended when the execution of the interrupt process is completed; and a stack pointer for saving the data in the stack and fetching the data stored in the stack, so as to implement the above interrupt control.
However, since the operation returns, upon completion of the execution of the interrupt process, to the original, suspended process and resumes it, as shown in FIGS. 17 and 18, the above conventional interrupt control method is disadvantageous in that the resumption of the original, suspended process may become meaningless or unnecessary, depending on the result of the interrupt process.
A specific description will be given to the disadvantage mentioned above. In the case where a sequence of image data is compressed (the amount of image data is reduced by encryption) and stored, e.g., it is assumed that the sequence of image data is expanded (image data is restored by decoding) and the expanded image data is displayed on the screen of a display unit. In general, each set of compressed image data is preliminarily subjected to error detection (for an error not in a compression process but in data transmission or the like) and, if any error that is correctable is detected, a correction process is performed so as to correct the error, followed by an expansion process. Subsequently, a display process is performed in which the sets of image data obtained through the expansion process are sequentially displayed in real time in the corresponding pixels on the screen of the display unit. In the case where the sets of image data which correspond in number to one screen on the display unit (for one frame) are displayed in one screen, if an error in data transmission or the like is detected in the above sets of image data for one frame and if it is judged that the sets of image data for one frame cannot be displayed in one screen because the error is uncorrectable, it is meaningless to perform the subsequent expansion process with respect to the above sets of image data for one frame. In this case, according to the conventional interrupt control methods, interrupt control is implemented by displaying again the previous sets of image data for one frame upon detection of the error in the sets of image data. After the processing, however, the unnecessary process of expanding sets of image data subsequent to the above set of image data containing the error is resumed, which renders the conventional interrupt control methods disadvantageous.